import urllib2
import sys

#// START OMIT
def lazy(url):
    return urllib2.urlopen(url).read()

def cheating(url):
    try:
        return urllib2.urlopen(url).read()
    except:
        # local handling
        e = sys.exc_info()[0]
        print >>sys.stderr, 'failed to fetch url "%s": %s' % (url, e)
        # forward error
        raise

def careful(url):
    try:
        return urllib2.urlopen(url).read()
    except ValueError as e:
        # local handling
        print >>sys.stderr, 'failed to fetch url "%s": %s' % (url, e)
        raise
    except IOError as e:
        # ignore error
        pass
#// STOP OMIT

if __name__ == '__main__':
    # lazy('foo.com')
# simple('http://1asdasdadsasd.com')
    print careful('http://asdasdasdfasdf.com')
